{template 'public/header'}
{template 'public/comhead'}
<input type="hidden" name="schoolid" value="{$schoolid}" />
    <div class="panel panel-info">
        <div class="panel-body">
           {php echo $this -> set_tabbar($action1, $schoolid, $_W['role'], $_W['isfounder']);}
        </div>
    </div>
<ul class="nav nav-tabs">
    <li {if $operation == 'post'}class="active"{/if}><a href="{php echo $this->createWebUrl('score', array('op' => 'post', 'schoolid' => $schoolid))}">添加成绩期号</a></li>
    <li {if $operation == 'display'}class="active"{/if}><a href="{php echo $this->createWebUrl('score', array('op' => 'display', 'schoolid' => $schoolid))}">成绩期号管理</a></li>
</ul>
 <style>
.cLine { overflow: hidden;padding: 5px 0;color:#000000;}
.alert {
padding: 8px 35px 0 10px;
text-shadow: none;
-webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
background-color: #f9edbe;
border: 1px solid #f0c36d;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
color: #333333;
margin-top: 5px;
}
.alert p {
margin: 0 0 10px;
display: block;
}
.alert .bold{
font-weight:bold;
}
 </style>
<div class="cLine">
    <div class="alert">
    <p><span class="bold">使用方法：</span>
   填写成绩期号,如 一诊,第一次月考,第二次月考....<br/>
   <strong><font color='red'>特别提醒: 当你删除该成绩期号项的时候,该成绩期号项下相关的所有数据都会被删除,请谨慎操作!以免丢失数据!</font></strong>
    </p>
    </div>
</div>
{if $operation == 'post'}
<div class="main">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <input type="hidden" name="parentid" value="{$parent['id']}" />
		<input type="hidden" name="schoolid" value="{$schoolid}" />	
        <div class="panel panel-default">
            <div class="panel-heading">
                成绩期号分类编辑编辑
            </div>
            <div class="panel-body">
                {if !empty($parentid)}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">上级分类</label>
                    <div class="col-sm-9">
                        {$parent['name']}
                    </div>
                </div>
                {/if}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">排序</label>
                    <div class="col-sm-9">
                        <input type="text" name="ssort" class="form-control" value="{$score['ssort']}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">成绩期号名称</label>
                    <div class="col-sm-9">
                        <input type="text" name="catename" class="form-control" value="{$score['sname']}" />
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group col-sm-12">
            <input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
            <input type="hidden" name="token" value="{$_W['token']}" />
        </div>
    </form>
</div>
{elseif $operation == 'display'}
<div class="main">
    <div class="panel panel-default">
        <div class="panel-body">
            <a class="btn btn-primary" href="javascript:location.reload()"><i class="fa fa-refresh"></i>刷新</a>
        </div>
    </div>
    <div class="panel panel-default">
        <form action="" method="post" class="form-horizontal form" >
            <input type="hidden" name="schoolid" value="{$schoolid}" />
            <div class="table-responsive panel-body">
                <table class="table table-hover">
                    <thead class="navbar-inner">
                    <tr>
					    <th style="width:100px;">序号</th>
                        <th>成绩期号名称</th>
                        <th style="text-align:right;">编辑/删除</th>
                    </tr>
                    </thead>
                    <tbody id="level-list">
                    {loop $score $row}
                    <tr>
					    <td><div class="type-parent">{$row['sid']}</div></td>
                        <td><div class="type-parent">{$row['sname']}&nbsp;&nbsp;</div></td>
                        <td style="text-align:right;"><a class="btn btn-default btn-sm" href="{php echo $this->createWebUrl('score', array('op' => 'post', 'sid' => $row['sid'], 'schoolid' => $schoolid))}" title="编辑"><i class="fa fa-pencil"></i></a>&nbsp;&nbsp;<a class="btn btn-default btn-sm" href="{php echo $this->createWebUrl('score', array('op' => 'delete', 'sid' => $row['sid'], 'schoolid' => $schoolid))}" onclick="return confirm('确认删除此分类吗？');return false;" title="删除"><i class="fa fa-times"></i></a></td>
                    </tr>
                    {/loop}
                    <!--tr>
                        <td colspan="3">
                            <input name="submit" type="submit" class="btn btn-primary" value="批量更新排序">
                            <input type="hidden" name="token" value="{$_W['token']}" />
                        </td>
                    </tr-->
                    </tbody>
                </table>
            </div>
        </form>
    </div>
    {$pager}
</div>
{/if}
{template 'public/footer'}